package com.sax.parsers;

import javax.xml.parsers.*;

import org.xml.sax.InputSource;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Paths;

public class JoinSeparatedPosListCharactersMain
{
	public static void main(String args[])
	{
		SAXParserFactory factory = SAXParserFactory.newInstance();
		String xmlFilePath = args[0];
		
		try {
			SAXParser saxParser = factory.newSAXParser();
//			this.mOutputFileStream =
//					new PrintWriter(
//							new BufferedWriter(
//										new OutputStreamWriter(
//												new FileOutputStream(
//														Paths.get(outputDirectoryPath, outputFileName).toFile(),
//														appendOutput),
//												StandardCharsets.UTF_8)),
			saxParser.parse(
					new InputSource(
							new BufferedReader(
									new InputStreamReader(
											new FileInputStream(xmlFilePath),
											StandardCharsets.UTF_8)
									)
							),
							new JoinSeparatedPosListCharacters());
			
		} catch (Exception e) {
			System.out.println(e);
		}
	}
}
